///@file SobolSequence.h
///@brief Declaration of the class representing a multidimensionnal Sobol Séquence
///@author Arnaud Duval
///@version 0.0
///@date 2009/03/11


#ifndef SOBOLSEQUENCE_H
#define SOBOLSEQUENCE_H

#include <assert.h>
#include <iostream>

///@class SobolSequence
///@brief Class defining a Sobol sequence
///A Sobol sequence is a two entry tabular
///Generation algorithm from S.Joe and F.Y. Kuo : http://web.maths.unsw.edu.au/~fkuo/sobol/index.html
class SobolSequence
{
	private:
		///@brief Dimension of the space where points are generated
		unsigned int D;
		///@brief Number of points
		unsigned int N;
		///@brief tabular containing the points
		double **pts;
	public:
		///@brief Default constructor
		SobolSequence();
		///@brief Constructor with given size and dimension
		SobolSequence(unsigned int, unsigned int);
		///@brief Destructor
		~SobolSequence();
		///@brief overload of [] operator : direct access to a realisation
		double* operator[] (unsigned int);
		///@brief Transform a variable to Gauss distribution
		void TransformGauss(unsigned int, double, double);
		///@brief Transform a variable to a uniform distribution
		void TransformUniform(unsigned int, double, double);
		///@brief Return number of points
		int Nbpts();
		///@brief Return dimension
		int Dim();


		///@brief Overload of << operator
		friend std::ostream& operator << (std::ostream&, const SobolSequence&);
};


#endif